import datetime


class chg_0:
    def __init__(self):
        self.prebar=None
    def onbar(self,b,timekey=None):
        if self.prebar!=None:
            rst= max(abs(b["high"]-b["close"]),abs(b["low"]-b["close"]),abs(b["high"]-b["low"]))
        else:
            rst= 0
        self.prebar=b
        return rst

